/*     */ package com.zimbra.cs.util;
/*     */ 
/*     */ import com.zimbra.common.account.Key.AccountBy;
/*     */ import com.zimbra.common.account.Key.DomainBy;
/*     */ import com.zimbra.common.account.ZAttrProvisioning.DomainAggregateQuotaPolicy;
/*     */ import com.zimbra.common.localconfig.KnownKey;
/*     */ import com.zimbra.common.localconfig.LC;
/*     */ import com.zimbra.common.mime.shim.JavaMailInternetAddress;
/*     */ import com.zimbra.common.service.ServiceException;
/*     */ import com.zimbra.common.util.EmailUtil;
/*     */ import com.zimbra.common.util.Log;
/*     */ import com.zimbra.common.util.StringUtil;
/*     */ import com.zimbra.common.util.SystemUtil;
/*     */ import com.zimbra.common.util.ZimbraLog;
/*     */ import com.zimbra.cs.account.AccessManager;
/*     */ import com.zimbra.cs.account.Account;
/*     */ import com.zimbra.cs.account.AuthToken;
/*     */ import com.zimbra.cs.account.DataSource;
/*     */ import com.zimbra.cs.account.Domain;
/*     */ import com.zimbra.cs.account.NamedEntry;
/*     */ import com.zimbra.cs.account.Provisioning;
/*     */ import com.zimbra.cs.account.Server;
/*     */ import com.zimbra.cs.mailbox.MailItem.Type;
/*     */ import com.zimbra.cs.mailbox.MailServiceException;
/*     */ import com.zimbra.cs.mailbox.Mailbox;
/*     */ import com.zimbra.soap.admin.type.DataSourceType;
/*     */ import java.io.UnsupportedEncodingException;
/*     */ import java.util.HashSet;
/*     */ import java.util.List;
/*     */ import java.util.Set;
/*     */ import javax.mail.Address;
/*     */ import javax.mail.MessagingException;
/*     */ import javax.mail.internet.InternetAddress;
/*     */ import javax.mail.internet.MimeMessage;
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ public class AccountUtil
/*     */ {
/*     */   public static long getEffectiveQuota(Account acct)
/*     */     throws ServiceException
/*     */   {
/*  65 */     long acctQuota = acct.getLongAttr("zimbraMailQuota", 0L);
/*  66 */     Domain domain = Provisioning.getInstance().getDomain(acct);
/*  67 */     long domainQuota = 0L;
/*  68 */     if (domain != null) {
/*  69 */       domainQuota = domain.getLongAttr("zimbraMailDomainQuota", 0L);
/*     */     }
/*  71 */     if (acctQuota == 0L)
/*  72 */       return domainQuota;
/*  73 */     if (domainQuota == 0L) {
/*  74 */       return acctQuota;
/*     */     }
/*  76 */     return Math.min(acctQuota, domainQuota);
/*     */   }
/*     */   
/*     */   public static boolean isOverAggregateQuota(Domain domain)
/*     */   {
/*  81 */     long quota = domain.getDomainAggregateQuota();
/*  82 */     return (quota != 0L) && (domain.getLongAttr("zimbraAggregateQuotaLastUsage", 0L) > quota);
/*     */   }
/*     */   
/*     */   public static boolean isSendAllowedOverAggregateQuota(Domain domain) {
/*  86 */     return domain.getDomainAggregateQuotaPolicy().isALLOWSENDRECEIVE();
/*     */   }
/*     */   
/*     */   public static boolean isReceiveAllowedOverAggregateQuota(Domain domain) {
/*  90 */     return !domain.getDomainAggregateQuotaPolicy().isBLOCKSENDRECEIVE();
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static void checkQuotaWhenSendMail(Mailbox mbox)
/*     */     throws ServiceException
/*     */   {
/*  99 */     Account account = mbox.getAccount();
/* 100 */     long acctQuota = getEffectiveQuota(account);
/* 101 */     if ((account.isMailAllowReceiveButNotSendWhenOverQuota()) && (acctQuota != 0L) && (mbox.getSize() > acctQuota)) {
/* 102 */       throw MailServiceException.QUOTA_EXCEEDED(acctQuota);
/*     */     }
/* 104 */     Domain domain = Provisioning.getInstance().getDomain(account);
/* 105 */     if ((domain != null) && (isOverAggregateQuota(domain)) && (!isSendAllowedOverAggregateQuota(domain)))
/*     */     {
/* 107 */       throw MailServiceException.DOMAIN_QUOTA_EXCEEDED(domain.getDomainAggregateQuota());
/*     */     }
/*     */   }
/*     */   
/*     */   public static InternetAddress getFriendlyEmailAddress(Account acct)
/*     */   {
/* 113 */     String personalPart = acct.getAttr("displayName");
/* 114 */     if (personalPart == null) {
/* 115 */       personalPart = acct.getAttr("cn");
/*     */     }
/* 117 */     if ((personalPart == null) || (personalPart.trim().equals("")) || (personalPart.equals(acct.getAttr("uid")))) {
/* 118 */       personalPart = null;
/*     */     }
/*     */     String address;
/*     */     try {
/* 122 */       address = getCanonicalAddress(acct);
/*     */     } catch (ServiceException se) {
/* 124 */       ZimbraLog.misc.warn("unexpected exception canonicalizing address, will use account name", se);
/* 125 */       address = acct.getName();
/*     */     }
/*     */     try
/*     */     {
/* 129 */       return new JavaMailInternetAddress(address, personalPart, "utf-8");
/*     */     }
/*     */     catch (UnsupportedEncodingException e)
/*     */     {
/*     */       try
/*     */       {
/* 135 */         return new JavaMailInternetAddress(address, personalPart);
/*     */       }
/*     */       catch (UnsupportedEncodingException e)
/*     */       {
/* 139 */         InternetAddress ia = new JavaMailInternetAddress();
/* 140 */         ia.setAddress(address);
/* 141 */         return ia;
/*     */       }
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */   public static InternetAddress getFromAddress(Account acct)
/*     */   {
/* 149 */     if (acct == null) {
/* 150 */       return null;
/*     */     }
/* 152 */     String address = (String)SystemUtil.coalesce(new String[] { acct.getPrefFromAddress(), acct.getName() });
/* 153 */     String personal = (String)SystemUtil.coalesce(new String[] { acct.getPrefFromDisplay(), acct.getDisplayName(), acct.getCn() });
/*     */     try {
/* 155 */       return new JavaMailInternetAddress(address, personal, "utf-8");
/*     */     } catch (UnsupportedEncodingException e) {
/* 157 */       ZimbraLog.system.error("Unable to encode address %s <%s>", new Object[] { personal, address });
/* 158 */       InternetAddress ia = new JavaMailInternetAddress();
/* 159 */       ia.setAddress(address);
/* 160 */       return ia;
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static InternetAddress getReplyToAddress(Account acct)
/*     */   {
/* 170 */     if (acct == null) {
/* 171 */       return null;
/*     */     }
/* 173 */     if (!acct.isPrefReplyToEnabled()) {
/* 174 */       return null;
/*     */     }
/* 176 */     String address = acct.getPrefReplyToAddress();
/* 177 */     if (address == null) {
/* 178 */       return null;
/*     */     }
/* 180 */     String personal = acct.getPrefReplyToDisplay();
/*     */     try {
/* 182 */       return new JavaMailInternetAddress(address, personal, "utf-8");
/*     */     } catch (UnsupportedEncodingException e) {
/* 184 */       ZimbraLog.system.error("Unable to encode address %s <%s>", new Object[] { personal, address });
/* 185 */       InternetAddress ia = new JavaMailInternetAddress();
/* 186 */       ia.setAddress(address);
/* 187 */       return ia;
/*     */     }
/*     */   }
/*     */   
/*     */   public static boolean isDirectRecipient(Account acct, MimeMessage mm) throws ServiceException, MessagingException {
/* 192 */     return isDirectRecipient(acct, null, mm, -1);
/*     */   }
/*     */   
/*     */   public static boolean isDirectRecipient(Account acct, String[] otherAccountAddrs, MimeMessage mm, int maxToCheck) throws ServiceException, MessagingException {
/* 196 */     Address[] recipients = mm.getAllRecipients();
/* 197 */     if (recipients == null) {
/* 198 */       return false;
/*     */     }
/*     */     
/* 201 */     AccountAddressMatcher acctMatcher = new AccountAddressMatcher(acct);
/* 202 */     int numRecipientsToCheck = maxToCheck <= 0 ? recipients.length : Math.min(recipients.length, maxToCheck);
/* 203 */     for (int i = 0; i < numRecipientsToCheck; i++) {
/* 204 */       String msgAddress = ((InternetAddress)recipients[i]).getAddress();
/* 205 */       if (acctMatcher.matches(msgAddress)) {
/* 206 */         return true;
/*     */       }
/* 208 */       if (otherAccountAddrs != null) {
/* 209 */         for (String otherAddr : otherAccountAddrs) {
/* 210 */           if (otherAddr.equalsIgnoreCase(msgAddress)) {
/* 211 */             return true;
/*     */           }
/*     */         }
/*     */       }
/*     */     }
/*     */     
/* 217 */     return false;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static String getCanonicalAddress(Account account)
/*     */     throws ServiceException
/*     */   {
/* 226 */     String ca = account.getAttr("zimbraMailCanonicalAddress");
/*     */     
/*     */ 
/* 229 */     if (ca == null) {
/* 230 */       ca = account.getName();
/*     */     }
/* 232 */     String[] parts = EmailUtil.getLocalPartAndDomain(ca);
/* 233 */     if (parts == null) {
/* 234 */       return ca;
/*     */     }
/* 236 */     Domain domain = Provisioning.getInstance().getDomain(Key.DomainBy.name, parts[1], true);
/* 237 */     if (domain == null) {
/* 238 */       return ca;
/*     */     }
/* 240 */     String domainCatchAll = domain.getAttr("zimbraMailCatchAllCanonicalAddress");
/* 241 */     if (domainCatchAll != null) {
/* 242 */       return parts[0] + domainCatchAll;
/*     */     }
/* 244 */     return ca;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */   public static boolean addressMatchesAccountOrSendAs(Account acct, String givenAddress)
/*     */     throws ServiceException
/*     */   {
/* 252 */     return new AccountAddressMatcher(acct, false, true).matches(givenAddress);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean addressMatchesAccount(Account acct, String givenAddress)
/*     */     throws ServiceException
/*     */   {
/* 261 */     return new AccountAddressMatcher(acct).matches(givenAddress);
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Set<String> getEmailAddresses(Account acct)
/*     */     throws ServiceException
/*     */   {
/* 271 */     Set<String> addrs = new HashSet();
/*     */     
/* 273 */     addrs.add(acct.getName().toLowerCase());
/* 274 */     addrs.add(getCanonicalAddress(acct).toLowerCase());
/*     */     
/* 276 */     String[] accountAliases = acct.getMailAlias();
/* 277 */     for (String addr : accountAliases) {
/* 278 */       addrs.add(addr.toLowerCase());
/*     */     }
/* 280 */     String[] allowedFromAddrs = acct.getMultiAttr("zimbraAllowFromAddress");
/* 281 */     for (String addr : allowedFromAddrs) {
/* 282 */       addrs.add(addr.toLowerCase());
/*     */     }
/* 284 */     return addrs;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static Set<String> getImapPop3EmailAddresses(Account acct)
/*     */     throws ServiceException
/*     */   {
/* 294 */     List<DataSource> dataSources = acct.getAllDataSources();
/* 295 */     Set<String> addrs = new HashSet();
/* 296 */     for (DataSource dataSource : dataSources) {
/* 297 */       DataSourceType dataSourceType = dataSource.getType();
/* 298 */       if ((dataSourceType == DataSourceType.imap) || (dataSourceType == DataSourceType.pop3)) {
/* 299 */         addrs.add(dataSource.getEmailAddress().toLowerCase());
/*     */       }
/*     */     }
/* 302 */     return addrs;
/*     */   }
/*     */   
/*     */   public static long getMaxInternalShareLifetime(Account account, MailItem.Type folderType) {
/* 306 */     switch (folderType) {
/*     */     case DOCUMENT: 
/* 308 */       return account.getFileShareLifetime();
/*     */     case UNKNOWN: 
/* 310 */       return minShareLifetime(account.getFileShareLifetime(), account.getShareLifetime());
/*     */     }
/* 312 */     return account.getShareLifetime();
/*     */   }
/*     */   
/*     */   public static long getMaxExternalShareLifetime(Account account, MailItem.Type folderType)
/*     */   {
/* 317 */     switch (folderType) {
/*     */     case DOCUMENT: 
/* 319 */       return account.getFileExternalShareLifetime();
/*     */     case UNKNOWN: 
/* 321 */       return minShareLifetime(account.getFileExternalShareLifetime(), account.getExternalShareLifetime());
/*     */     }
/* 323 */     return account.getExternalShareLifetime();
/*     */   }
/*     */   
/*     */   public static long getMaxPublicShareLifetime(Account account, MailItem.Type folderType)
/*     */   {
/* 328 */     switch (folderType) {
/*     */     case DOCUMENT: 
/* 330 */       return account.getFilePublicShareLifetime();
/*     */     case UNKNOWN: 
/* 332 */       return minShareLifetime(account.getFilePublicShareLifetime(), account.getPublicShareLifetime());
/*     */     }
/* 334 */     return account.getPublicShareLifetime();
/*     */   }
/*     */   
/*     */ 
/*     */   private static long minShareLifetime(long shareLifetime1, long shareLifetime2)
/*     */   {
/* 340 */     if (shareLifetime1 == 0L)
/* 341 */       return shareLifetime2;
/* 342 */     if (shareLifetime2 == 0L) {
/* 343 */       return shareLifetime1;
/*     */     }
/* 345 */     return Math.min(shareLifetime1, shareLifetime2);
/*     */   }
/*     */   
/*     */   public static class AccountAddressMatcher
/*     */   {
/*     */     private Account account;
/*     */     private boolean matchSendAs;
/*     */     private Set<String> addresses;
/*     */     
/*     */     public AccountAddressMatcher(Account account) throws ServiceException {
/* 355 */       this(account, false, false);
/*     */     }
/*     */     
/*     */     public AccountAddressMatcher(Account account, boolean internalOnly) throws ServiceException {
/* 359 */       this(account, internalOnly, false);
/*     */     }
/*     */     
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */     public AccountAddressMatcher(Account account, boolean internalOnly, boolean matchSendAs)
/*     */       throws ServiceException
/*     */     {
/* 370 */       this.account = account;
/* 371 */       this.matchSendAs = matchSendAs;
/*     */       
/* 373 */       this.addresses = new HashSet();
/* 374 */       if (account != null) {
/* 375 */         String mainAddr = account.getName();
/* 376 */         if (!StringUtil.isNullOrEmpty(mainAddr)) {
/* 377 */           this.addresses.add(mainAddr.toLowerCase());
/*     */         }
/* 379 */         String canonAddr = AccountUtil.getCanonicalAddress(account);
/* 380 */         if (!StringUtil.isNullOrEmpty(canonAddr)) {
/* 381 */           this.addresses.add(canonAddr.toLowerCase());
/*     */         }
/* 383 */         String[] aliases = account.getMailAlias();
/* 384 */         if (aliases != null) {
/* 385 */           for (String alias : aliases) {
/* 386 */             if (!StringUtil.isNullOrEmpty(alias)) {
/* 387 */               this.addresses.add(alias.toLowerCase());
/*     */             }
/*     */           }
/*     */         }
/* 391 */         if (!internalOnly) {
/* 392 */           String[] addrs = account.getMultiAttr("zimbraAllowFromAddress");
/* 393 */           if (addrs != null) {
/* 394 */             for (String addr : addrs) {
/* 395 */               if (!StringUtil.isNullOrEmpty(addr)) {
/* 396 */                 this.addresses.add(addr.toLowerCase());
/*     */               }
/*     */             }
/*     */           }
/*     */         }
/*     */       } else {
/* 402 */         ZimbraLog.account.warn("Account is null.");
/*     */       }
/*     */     }
/*     */     
/*     */     public boolean matches(String address) throws ServiceException {
/* 407 */       return matches(address, true);
/*     */     }
/*     */     
/*     */     private boolean matches(String address, boolean checkDomainAlias) throws ServiceException {
/* 411 */       if (StringUtil.isNullOrEmpty(address)) {
/* 412 */         return false;
/*     */       }
/* 414 */       if (this.account == null) {
/* 415 */         return false;
/*     */       }
/* 417 */       if (this.addresses.contains(address.toLowerCase())) {
/* 418 */         return true;
/*     */       }
/* 420 */       boolean match = false;
/* 421 */       if (checkDomainAlias) {
/*     */         try {
/* 423 */           String addrByDomainAlias = Provisioning.getInstance().getEmailAddrByDomainAlias(address);
/* 424 */           if (addrByDomainAlias != null) {
/* 425 */             match = matches(addrByDomainAlias, false);
/*     */           }
/*     */         } catch (ServiceException e) {
/* 428 */           ZimbraLog.account.warn("unable to get addr by alias domain" + e);
/*     */         }
/*     */       }
/* 431 */       if ((!match) && (this.matchSendAs)) {
/* 432 */         match = AccessManager.getInstance().canSendAs(this.account, this.account, address, false);
/*     */       }
/* 434 */       if (match) {
/* 435 */         this.addresses.add(address.toLowerCase());
/*     */       }
/* 437 */       return match;
/*     */     }
/*     */   }
/*     */   
/*     */   public static String getSoapUri(Account account) {
/* 442 */     String base = getBaseUri(account);
/* 443 */     return base + "/service/soap/";
/*     */   }
/*     */   
/*     */   public static String getBaseUri(Account account) {
/* 447 */     if (account == null) {
/* 448 */       return null;
/*     */     }
/*     */     try {
/* 451 */       Server server = Provisioning.getInstance().getServer(account);
/* 452 */       if (server == null) {
/* 453 */         ZimbraLog.account.warn("no server associated with acccount " + account.getName());
/* 454 */         return null;
/*     */       }
/* 456 */       return getBaseUri(server);
/*     */     } catch (ServiceException e) {
/* 458 */       ZimbraLog.account.warn("error fetching SOAP URI for account " + account.getName(), e); }
/* 459 */     return null;
/*     */   }
/*     */   
/*     */   public static String getBaseUri(Server server)
/*     */   {
/* 464 */     if (server == null) {
/* 465 */       return null;
/*     */     }
/* 467 */     String host = server.getAttr("zimbraServiceHostname");
/* 468 */     String mode = server.getAttr("zimbraMailMode", "http");
/* 469 */     int port = server.getIntAttr("zimbraMailPort", 0);
/* 470 */     if ((port > 0) && (!mode.equalsIgnoreCase("https")) && (!mode.equalsIgnoreCase("redirect")))
/* 471 */       return "http://" + host + ':' + port;
/* 472 */     if (!mode.equalsIgnoreCase("http")) {
/* 473 */       port = server.getIntAttr("zimbraMailSSLPort", 0);
/* 474 */       if (port > 0)
/* 475 */         return "https://" + host + ':' + port;
/*     */     }
/* 477 */     ZimbraLog.account.warn("no service port available on host " + host);
/* 478 */     return null;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static void addAccountToLogContext(Provisioning prov, String id, String nameKey, String idOnlyKey, AuthToken authToken)
/*     */   {
/* 515 */     Account acct = null;
/*     */     try {
/* 517 */       acct = prov.get(Key.AccountBy.id, id, authToken);
/*     */     } catch (ServiceException se) {
/* 519 */       ZimbraLog.misc.warn("unable to lookup account for log, id: " + id, se);
/*     */     }
/* 521 */     if (acct == null) {
/* 522 */       ZimbraLog.addToContext(idOnlyKey, id);
/*     */     } else {
/* 524 */       ZimbraLog.addToContext(nameKey, acct.getName());
/*     */     }
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean isGalSyncAccount(Account account)
/*     */   {
/* 535 */     boolean isGalSync = false;
/*     */     try {
/* 537 */       Domain domain = Provisioning.getInstance().getDomain(account);
/* 538 */       if (domain != null) {
/* 539 */         for (String galAcctId : domain.getGalAccountId()) {
/* 540 */           if (galAcctId.equals(account.getId())) {
/* 541 */             isGalSync = true;
/* 542 */             break;
/*     */           }
/*     */         }
/*     */       }
/*     */     } catch (ServiceException e) {
/* 547 */       ZimbraLog.misc.warn("unable to lookup domain for account, id: " + account.getId());
/*     */     }
/* 549 */     return isGalSync;
/*     */   }
/*     */   
/*     */ 
/*     */ 
/*     */ 
/*     */ 
/*     */   public static boolean isZDesktopLocalAccount(String accountId)
/*     */   {
/* 558 */     String zdLocalAcctId = LC.zdesktop_local_account_id.value();
/* 559 */     return (zdLocalAcctId != null) && (zdLocalAcctId.equalsIgnoreCase(accountId));
/*     */   }
/*     */   
/*     */   public static String[] getAllowedSendAddresses(NamedEntry grantor) {
/* 563 */     String[] addrs = grantor.getMultiAttr("zimbraPrefAllowAddressForDelegatedSender");
/* 564 */     if (addrs.length == 0) {
/* 565 */       addrs = new String[] { grantor.getName() };
/*     */     }
/* 567 */     return addrs;
/*     */   }
/*     */   
/*     */   public static boolean isAllowedSendAddress(NamedEntry grantor, String address) {
/* 571 */     String[] addrs = getAllowedSendAddresses(grantor);
/* 572 */     for (String a : addrs) {
/* 573 */       if (a.equalsIgnoreCase(address)) {
/* 574 */         return true;
/*     */       }
/*     */     }
/* 577 */     return false;
/*     */   }
/*     */   
/*     */   public static boolean isAllowedDataSourceSendAddress(Account account, String address) throws ServiceException
/*     */   {
/* 582 */     if ((address == null) || (addressHasInternalDomain(address)))
/*     */     {
/* 584 */       return false;
/*     */     }
/* 586 */     List<DataSource> dsList = Provisioning.getInstance().getAllDataSources(account);
/* 587 */     for (DataSource ds : dsList) {
/* 588 */       DataSourceType dsType = ds.getType();
/* 589 */       if ((ds.isEnabled()) && ((DataSourceType.pop3.equals(dsType)) || (DataSourceType.imap.equals(dsType)) || (DataSourceType.caldav.equals(dsType))) && (address.equalsIgnoreCase(ds.getEmailAddress())))
/*     */       {
/*     */ 
/* 592 */         return true;
/*     */       }
/*     */     }
/* 595 */     return false;
/*     */   }
/*     */   
/*     */   public static boolean addressHasInternalDomain(String address)
/*     */     throws ServiceException
/*     */   {
/* 601 */     String domain = EmailUtil.getValidDomainPart(address);
/* 602 */     if (domain != null) {
/* 603 */       Provisioning prov = Provisioning.getInstance();
/* 604 */       Domain internalDomain = prov.getDomain(Key.DomainBy.name, domain, true);
/* 605 */       if (internalDomain != null) {
/* 606 */         return true;
/*     */       }
/*     */     }
/* 609 */     return false;
/*     */   }
/*     */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/util/AccountUtil.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */